package FileIO.ReaderWriter;

import java.io.*;

public class useInputStreamReader {
    public static void main(String[] args) throws IOException {
        Reader reader = new InputStreamReader(new FileInputStream("src/main/data/hello.txt"), "GB2312");
        try {
            char[] buf = new char[1024];
            int charsRead = reader.read(buf);
            System.out.println(new String(buf, 0, charsRead));
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            reader.close();
        }
    }
}
